<?php


class User
{
    public $userName = 'guest';
    public $userAge = 18;
    public $delegator = null;

    /**
     * 获取折扣
     * @return int
     */
    public function getDiscount()
    {
        return 1;
    }
    public function __call(string $name, array $arguments)
    {
        if ($this->delegator != null){
            return call_user_func_array([$this->delegator, $name], $arguments);
        }
        return false;
    }
}